//
//  CustomSaleDetView.m
//  YouGoWeGo
//
//  Created by LiuFei on 14/11/20.
//  Copyright (c) 2014年 LiuFei. All rights reserved.
//

#import "CustomSaleDetView.h"

@implementation CustomSaleDetView

- (void)dealloc
{
    [_nameLabel release];
    [_image release];
    [_priceLabel release];
    [_startAreaLabel release];
    [_commDetailLabel release];
    [_wantButton release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        self.image = [[UIImageView alloc] init];
        [_image setFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height / 2)];
        [self addSubview:_image];
        [_image release];
        
        self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, self.image.frame.size.height + 10, [UIScreen mainScreen].bounds.size.width - 30, 30)];
        [self addSubview:_nameLabel];
        [_nameLabel release];
        
        self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 2 - 50, self.image.frame.size.height + 40, 100, 30)];
        //[self.priceLabel setBackgroundColor:[UIColor yellowColor]];
        [self addSubview:_priceLabel];
        [_priceLabel release];
        
        self.startAreaLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, self.image.frame.size.height + 40, [UIScreen mainScreen].bounds.size.width, 30)];
        [self addSubview:_startAreaLabel];
        [_startAreaLabel release];
        
        self.commentLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, self.image.frame.size.height + 80, 80, 30)];
        [self.commentLabel setFont:[UIFont systemFontOfSize:25]];
        [self addSubview:_commentLabel];
        [_commentLabel release];
        
        self.wantButton = [[UIButton alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 2 + 80, self.image.frame.size.height + 40, 60, 30)];
        //[self.wantButton setBackgroundColor:[UIColor blackColor]];
        [self.wantButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self addSubview:_wantButton];
        [_wantButton release];
        
        
        
        
    }
    return self;
}

@end
